package com.hqyj.springBoot.modules.account.controller;

import com.hqyj.springBoot.modules.common.vo.Result;
import com.hqyj.springBoot.modules.account.entity.UserRole;
import com.hqyj.springBoot.modules.account.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class UserRoleController {

    @Autowired
    private UserRoleService userRoleService;


    /**
     * 127.0.0.1/api/userRole ---post
     * {"userId":6,"roleId":3}
     */
    @PostMapping(value = "/userRole",consumes = MediaType.APPLICATION_JSON_VALUE)
    Result<UserRole> insertUserRole(@RequestBody UserRole userRole){
        return userRoleService.insertUserRole(userRole);
    }

}
